package com.miaosha.ms_04.prefix;

/**
 * @Description //TODO
 * @Author Administrator
 * @DATE 2020/9/14 21:13
 **/
public class AbsBaseKeyPrefix implements KeyPrefix {

    private int expireTime;

    private String prefix;

    public AbsBaseKeyPrefix(String prefix) {
        this(0, prefix);
    }

    public AbsBaseKeyPrefix(int expireTime, String prefix) {
        this.expireTime = expireTime;
        this.prefix = prefix;
    }

    @Override
    public int getExpireTime() {
        return expireTime;
    }

    @Override
    public String getPrefix() {
        String className = getClass().getSimpleName();
        return className + "-" + prefix;
    }
}
